import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class qweqwe {
    public static void main(String[] args) {
        Calendar calendar = Calendar.getInstance();
        calendar.add(Calendar.DAY_OF_MONTH,10);
        int i = calendar.get(Calendar.DAY_OF_WEEK);
        if (i != 1) {
            calendar.add(Calendar.DAY_OF_MONTH, -i+ 2);
        }else {
            calendar.add(Calendar.DAY_OF_MONTH,-6);
        }
        Date time = calendar.getTime();
        String format = new SimpleDateFormat("yyy-MM-dd").format(time);
        System.out.println(format);
        calendar.add(Calendar.DAY_OF_MONTH,6);
        Date time1 = calendar.getTime();
        String format2 = new SimpleDateFormat("yyy-MM-dd").format(time1);
        System.out.println(format2);
    }
}
